package com.cjj.common.consts;

import lombok.Getter;

/**
 * @author DoyuTu
 * @version 0.0.1 java-asset-data
 */
@Getter
public enum ResConst {
    /**
     * 成功
     */
    INIT(0, "初始"),
    OK(200, "成功"),
    BAD_REQUEST(400, "错误的请求"),
    UNAUTHORIZED_ERROR(401, "未授权"),
    FORBIDDEN_ERROR(403, "拒绝访问"),
    NOT_FOUND_ERROR(404, "请求不存在！"),
    METHOD_NOT_ALLOWED(405, "请求方式不支持"),
    SYSTEM_ERROR(500, "服务运行异常，请联系管理员"),
    BUSINESS_ERROR(9001, "服务繁忙，请稍后再试"),
    PARAMETER_ERROR(9002, "参数不合法"),

    /**
     * 用户错误
     */
    USERNAME_PASSWORD_ERROR(5001, "用户名或密码错误！"),
    LOGIN_EXPIRED(5002, "请重新登录"),
    TOKEN_OUT_OF_CTRL(5003, "当前用户已在别处登录，请尝试更改密码或重新登录！"),
    CODE_ERROR(5004,"验证码错误"),
    ACCOUNT_EXIST(5005,"账号已存在"),
    PHONE_NOT_EXIST(5006,"手机号不存在"),
    PASSWORD_EDIT_REPEAT(5007,"新密码与旧密码相同"),
    OLD_PASSWORD_ERROR(5008,"原密码错误"),

    /**
     * 业务错误
     */
    OUT_OF_LEVEL(6001,"客户使用机构层级大于6级，请重新选择上级机构"),
    OUT_OF_LIMIT_NUM(6002,"创建数量已达上限"),
    SUB_DOMAIN_ALREADY_EXIST(6003,"二级域名已存在"),
    ORGANIZATION_NAME_ALREADY_EXIST(6004,"机构名称已存在"),
    OPERATION_COMPLETE_BY_ANYONE(6005,"操作已完成，请勿重复操作"),
    DONT_ALLOW_RECALL_BACK(6006,"该条数据不符合召回条件，不允许召回"),

    /**
     * 数据库
     */
    DATA_NOT_FOUND(8001,"数据未找到"),

    DEFAULT_ERROR(9001,"未知错误")
    ;

    private int code;
    private String message;

    ResConst(int code, String message) {
        this.code = code;
        this.message = message;
    }
}
